<template>
  <div ref="chart" style="width: 100%; height: 400px;"></div>
</template>

<script>
import echarts from 'echarts'

export default {
  mounted () {
    this.renderChart()
  },
  methods: {
    renderChart () {
      const chart = echarts.init(this.$refs.chart)
      chart.setOption({
        // Echarts 图表配置项
        xAxis: {
          type: 'category',
          data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            data: [150, 230, 224, 218, 135, 147, 260],
            type: 'bar'
          }
        ]
      })
    }
  }
}
</script>
